package com.forezp.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.forezp.dao.DeviceTypeMapper;
import com.service.bean.DeviceType;
import com.forezp.service.DeviceTypeService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
@Service
public class DeviceTypeServiceImpl implements DeviceTypeService{

	 @Autowired
	 private DeviceTypeMapper deviceTypeMapper;
	
	@Override
	public int deleteById(Integer id) {
		// TODO Auto-generated method stub
		return deviceTypeMapper.deleteById(id);
	}

	@Override
	public int insertDeviceType(DeviceType deviceType) {
		// TODO Auto-generated method stub
		return deviceTypeMapper.insertDeviceType(deviceType);
	}

	@Override
	public DeviceType getById(Integer id) {
		// TODO Auto-generated method stub
		return deviceTypeMapper.getById(id);
	}

	@Override
	public int updateById(DeviceType deviceType) {
		// TODO Auto-generated method stub
		return deviceTypeMapper.updateById(deviceType);
	}

	@Override
	public List<DeviceType> getList(DeviceType deviceType) {
		// TODO Auto-generated method stub
		return deviceTypeMapper.getList(deviceType);
	}

	@Override
	public PageInfo<DeviceType> getPage(DeviceType deviceType,
			Integer pageNumber, Integer pageSize) {
		// TODO Auto-generated method stub
		PageHelper.startPage(pageNumber,pageSize);
        List<DeviceType> deviceTypeList= deviceTypeMapper.getList(deviceType);
        
        System.out.println("=======" + deviceTypeList.size());
        
        return new PageInfo<DeviceType>(deviceTypeList);
	}

}
